package com.audaque.springboot.foshanupload.core.util;

import java.security.SecureRandom;

/**
 * @author zgb
 * @desc ...
 * @date 2023-02-10 20:20:25
 */
public class NoUitl {




    public static String gen(int totalLength,String prefix, String source) {
        int length0=0;
        String result = null;
        String resultSuffix = null;
        if (source != null) {
            source = source.replace(prefix, "");
            Integer i = Integer.parseInt(source);
            i++;
            length0=totalLength-prefix.length()-i.toString().length();
            resultSuffix = String.format("%0" + length0 + "d", i);

        } else {
            length0=totalLength-prefix.length()-1;
            resultSuffix = String.format("%0" + length0 + "d", 1);
        }
        result = prefix+ resultSuffix;
        return result;

    }
}
